package com.kandinfo.base.security.authc;

import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.authc.credential.PasswordMatcher;

public class NetEasePasswordMatcher  extends PasswordMatcher {
    protected Object getSubmittedPassword(AuthenticationToken token) {
    	if(token != null && token.getClass().equals(UsernamePasswordToken.class)){
    		return String.valueOf(((UsernamePasswordToken)token).getPassword())+Integer.toString(token.getPrincipal().toString().substring(0,4).hashCode());
    	}
    	return super.getSubmittedPassword(token);
    }
}
